/**
 * Copyright (C), 2015-2021, XXX有限公司
 * FileName: WorkOrderEnum
 * Author:   Administrator
 * Date:     2021/8/6 0006 10:44
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package cn.hxlc.tie.demo.core.enums;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author jf.xu
 * @create 2021/8/6 0006
 * @since 1.0.0
 */
import cn.hxlc.tie.libs.scanner.stereotype.EnumResource;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.core.enums.IEnum;

@EnumResource
public enum WorkOrderEnum implements IEnum<Integer>{

    ZC(0,"暂存"),
    SH(1,"审核"),
    XD(2,"下达"),
    SDGB(3,"手动关闭"),
    ZDGB(4,"自动关闭");
    @EnumValue
    private final int code;
    private final String descp;

    @Override
    public Integer getValue() {
        return this.code;
    }

    @Override
    public String toString() {
        return this.descp;
    }

    WorkOrderEnum(final int code, final String descp) {
        this.code = code;
        this.descp = descp;
    }

    public static WorkOrderEnum toEnum(Integer code) {
        if (null != code) {
            for (WorkOrderEnum e : WorkOrderEnum.values()) {
                if (e.getCode()==code) {
                    return e;
                }
            }
        }
        return null;
    }


    public int getCode() {
        return code;
    }
}
